#include <iostream>

using namespace std;


//内存泄露
void badardess(){
	int * ptemp;
	cout << "is it sunny(y/n)?" << endl;
	char userinput = 'y';
	cin >> userinput;
	if (userinput == 'y') {
		ptemp = new int;
		* ptemp = 30;
		cout << "ptemp is "<< *ptemp;
		delete ptemp;
	}
	
}
//内存分陪检测

void MemoryAllocationDetection(){
	try{
		int * page = new int[536870911];
		delete [] page;
	}
	catch(bad_alloc){
		cout << "aaa" << endl;	
	}
}

int main(int argc, char *argv[]) {
//	badardess();
	MemoryAllocationDetection();
}